package com.tzjz.entity;

import com.alibaba.fastjson.annotation.JSONField;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.experimental.Accessors;
import org.springframework.data.annotation.Id;

import java.util.Date;
import java.util.Set;


@TableName(value = "t_company_user")
@Data
@EqualsAndHashCode(callSuper = false)
@Accessors(chain = true)
public class CompanyUser {
    @Id
    @TableId(value = "id",type = IdType.AUTO)
    private int id;

    private String username;
    private String login;

    @TableField
    private String password;

    @TableField
    private String email;

    @TableField(value = "create_time")
    private Date createTime;


    @TableField
    private int status;


    @TableField(exist = false)
    @JSONField(serialize = false)
    private Set<Role> roles;

    @Override
    public String toString() {
        return "User{" +
                "id=" + id +
                ", username='" + username + '\'' +
                ", password='" + password + '\'' +
                ", email='" + email + '\'' +
                ", create_time=" + createTime +
                ", status=" + status +
                '}';
    }
}
